Optimal. Leaf size=113 \[ d^2 x \left (a+b \log \left (c x^n\right )\right )+\frac{2 d e x^{r+1} \left (a+b \log \left (c x^n\right )\right )}{r+1}+\frac{e^2 x^{2 r+1} \left (a+b \log \left (c x^n\right )\right )}{2 r+1}-b d^2 n x-\frac{2 b d e n x^{r+1}}{(r+1)^2}-\frac{b e^2 n x^{2 r+1}}{(2 r+1)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0762582, antiderivative size = 95, normalized size of antiderivative = 0.84, number of steps used = 2, number of rules used = 2, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.1, Rules used = {244, 2313} \[ \left (d^2 x+\frac{2 d e x^{r+1}}{r+1}+\frac{e^2 x^{2 r+1}}{2 r+1}\right ) \left (a+b \log \left (c x^n\right )\right )-b d^2 n x-\frac{2 b d e n x^{r+1}}{(r+1)^2}-\frac{b e^2 n x^{2 r+1}}{(2 r+1)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 244
Rule 2313
Rubi steps
\begin{align*} \int \left (d+e x^r\right )^2 \left (a+b \log \left (c x^n\right )\right ) \, dx &=\left (d^2 x+\frac{2 d e x^{1+r}}{1+r}+\frac{e^2 x^{1+2 r}}{1+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (d^2+\frac{2 d e x^r}{1+r}+\frac{e^2 x^{2 r}}{1+2 r}\right ) \, dx\\ &=-b d^2 n x-\frac{2 b d e n x^{1+r}}{(1+r)^2}-\frac{b e^2 n x^{1+2 r}}{(1+2 r)^2}+\left (d^2 x+\frac{2 d e x^{1+r}}{1+r}+\frac{e^2 x^{1+2 r}}{1+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}
Mathematica [A] time = 0.15896, size = 107, normalized size = 0.95 \[ x \left (\frac{2 d e x^r \left (a+b \log \left (c x^n\right )\right )}{r+1}+\frac{e^2 x^{2 r} \left (a+b \log \left (c x^n\right )\right )}{2 r+1}+a d^2+b d^2 \log \left (c x^n\right )-b d^2 n-\frac{2 b d e n x^r}{(r+1)^2}-\frac{b e^2 n x^{2 r}}{(2 r+1)^2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.288, size = 1921, normalized size = 17. \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.34927, size = 1041, normalized size = 9.21 \begin{align*} \frac{{\left (4 \, b d^{2} r^{4} + 12 \, b d^{2} r^{3} + 13 \, b d^{2} r^{2} + 6 \, b d^{2} r + b d^{2}\right )} x \log \left (c\right ) +{\left (4 \, b d^{2} n r^{4} + 12 \, b d^{2} n r^{3} + 13 \, b d^{2} n r^{2} + 6 \, b d^{2} n r + b d^{2} n\right )} x \log \left (x\right ) -{\left (4 \,{\left (b d^{2} n - a d^{2}\right )} r^{4} + b d^{2} n + 12 \,{\left (b d^{2} n - a d^{2}\right )} r^{3} - a d^{2} + 13 \,{\left (b d^{2} n - a d^{2}\right )} r^{2} + 6 \,{\left (b d^{2} n - a d^{2}\right )} r\right )} x +{\left ({\left (2 \, b e^{2} r^{3} + 5 \, b e^{2} r^{2} + 4 \, b e^{2} r + b e^{2}\right )} x \log \left (c\right ) +{\left (2 \, b e^{2} n r^{3} + 5 \, b e^{2} n r^{2} + 4 \, b e^{2} n r + b e^{2} n\right )} x \log \left (x\right ) +{\left (2 \, a e^{2} r^{3} - b e^{2} n + a e^{2} -{\left (b e^{2} n - 5 \, a e^{2}\right )} r^{2} - 2 \,{\left (b e^{2} n - 2 \, a e^{2}\right )} r\right )} x\right )} x^{2 \, r} + 2 \,{\left ({\left (4 \, b d e r^{3} + 8 \, b d e r^{2} + 5 \, b d e r + b d e\right )} x \log \left (c\right ) +{\left (4 \, b d e n r^{3} + 8 \, b d e n r^{2} + 5 \, b d e n r + b d e n\right )} x \log \left (x\right ) +{\left (4 \, a d e r^{3} - b d e n + a d e - 4 \,{\left (b d e n - 2 \, a d e\right )} r^{2} -{\left (4 \, b d e n - 5 \, a d e\right )} r\right )} x\right )} x^{r}}{4 \, r^{4} + 12 \, r^{3} + 13 \, r^{2} + 6 \, r + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 13.4626, size = 211, normalized size = 1.87 \begin{align*} a d^{2} x + 2 a d e \left (\begin{cases} \frac{x^{r + 1}}{r + 1} & \text{for}\: r \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) + a e^{2} \left (\begin{cases} \frac{x^{2 r + 1}}{2 r + 1} & \text{for}\: 2 r \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) - b d^{2} n x + b d^{2} x \log{\left (c x^{n} \right )} - 2 b d e n \left (\begin{cases} \frac{\begin{cases} \frac{x x^{r}}{r + 1} & \text{for}\: r \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}}{r + 1} & \text{for}\: r > -\infty \wedge r < \infty \wedge r \neq -1 \\\frac{\log{\left (x \right )}^{2}}{2} & \text{otherwise} \end{cases}\right ) + 2 b d e \left (\begin{cases} \frac{x^{r + 1}}{r + 1} & \text{for}\: r \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) \log{\left (c x^{n} \right )} - b e^{2} n \left (\begin{cases} \frac{\begin{cases} \frac{x x^{2 r}}{2 r + 1} & \text{for}\: r \neq - \frac{1}{2} \\\log{\left (x \right )} & \text{otherwise} \end{cases}}{2 r + 1} & \text{for}\: r > -\infty \wedge r < \infty \wedge r \neq - \frac{1}{2} \\\frac{\log{\left (x \right )}^{2}}{2} & \text{otherwise} \end{cases}\right ) + b e^{2} \left (\begin{cases} \frac{x^{2 r + 1}}{2 r + 1} & \text{for}\: 2 r \neq -1 \\\log{\left (x \right )} & \text{otherwise} \end{cases}\right ) \log{\left (c x^{n} \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.32161, size = 329, normalized size = 2.91 \begin{align*} \frac{2 \, b d n r x x^{r} e \log \left (x\right )}{r^{2} + 2 \, r + 1} + b d^{2} n x \log \left (x\right ) + \frac{2 \, b n r x x^{2 \, r} e^{2} \log \left (x\right )}{4 \, r^{2} + 4 \, r + 1} + \frac{2 \, b d n x x^{r} e \log \left (x\right )}{r^{2} + 2 \, r + 1} - b d^{2} n x - \frac{2 \, b d n x x^{r} e}{r^{2} + 2 \, r + 1} + b d^{2} x \log \left (c\right ) + \frac{2 \, b d x x^{r} e \log \left (c\right )}{r + 1} + \frac{b n x x^{2 \, r} e^{2} \log \left (x\right )}{4 \, r^{2} + 4 \, r + 1} + a d^{2} x - \frac{b n x x^{2 \, r} e^{2}}{4 \, r^{2} + 4 \, r + 1} + \frac{2 \, a d x x^{r} e}{r + 1} + \frac{b x x^{2 \, r} e^{2} \log \left (c\right )}{2 \, r + 1} + \frac{a x x^{2 \, r} e^{2}}{2 \, r + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]